package com.wanchuang.shengfubao.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wanchuang.shengfubao.R;
import com.wanchuang.shengfubao.proto.Withdraw;

import java.util.List;

public class TiXianProgressAdapter extends BaseQuickAdapter<Withdraw.withdraw_detail, BaseViewHolder> implements LoadMoreModule {


    public TiXianProgressAdapter(Context context, List<Withdraw.withdraw_detail> dataList) {
        super(R.layout.item_ti_xian_progress, dataList);
    }

    @Override
    protected void convert(BaseViewHolder helper, Withdraw.withdraw_detail item) {
        helper.setText(R.id.tv_money, "￥" + item.getPdcAmount())
                .setText(R.id.tv_ti_xian_time,  item.getPdcAddtime());
        String statue = "";
        switch (item.getPdcPaymentState()) {
            case "0":
                helper.setText(R.id.tv_allow_time, item.getPdcExpectTime());
                helper.setBackgroundResource(R.id.iv_statue,R.mipmap.icon_fa_qi);
                break;
            case "1":
                helper.setText(R.id.tv_allow_time, item.getPdcPaymentTime());
                helper.setBackgroundResource(R.id.iv_statue,R.mipmap.icon_success);
                break;
            case "2":
                helper.setText(R.id.tv_allow_time, item.getMsg());
                helper.setBackgroundResource(R.id.iv_statue,R.mipmap.icon_fail);
                break;
        }

//        if (item.getWalletType().equals("1")) {
            helper.setText(R.id.tv_title,item.getWalletType()+ "提现" );

//        } else {
//            helper.setText(R.id.tv_title, "返现账户提现" + statue);
//        }
    }

}
